package financial.sharing.center.contract.model.entity;

import financial.sharing.center.common.base.BaseEntity;
import financial.sharing.center.common.enums.EnableStatusEnum;
import financial.sharing.center.common.utils.BigDecimalUtil;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.ToString;

import javax.persistence.*;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @ClassName ContractDetail
 * @Description TODO
 * @Author guoyuhang
 * @ @csdn https://blog.csdn.net/qq_40788718
 * @Date 2021/4/5
 * @Version 1.0
 */
@Data
@AllArgsConstructor
@ToString
@Entity
public class ContractDetail extends BaseEntity {

    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    private Integer id;
    /**对应合同id*/
    private Integer contractId;
    /**预计收款或者付款*/
    private BigDecimal contractAmount;
    @Transient
    private BigDecimal accruedAmount;
    @Transient
    private BigDecimal billAmount;
    @Transient
    private BigDecimal invoiceAmount;
    /**账单周期*/
    private String billPeriod;
    /**币种*/
    private String currencyDicCode;
    /**备注*/
    private String note;
    /**付款方式*/
    private String payMethod;
    /**甲方*/
    private String firstParty;
    /**乙方*/
    private String secondParty;
    /**可用性*/
    private Integer enableStatusValue;

    public ContractDetail() {

    }

    public ContractDetail(Integer contractId, String firstParty, String secondParty) {
        this.contractId = contractId;
        this.firstParty = firstParty;
        this.secondParty = secondParty;
        this.contractAmount = BigDecimalUtil.ZERO;
        this.enableStatusValue = EnableStatusEnum.正常.getValue();
    }
}
